#!/bin/bash

case "$1" in
    start)
        echo "Checking device model..."
        model_output=$(batocera-model)
        if [[ $model_output == "SER9" ]]; then
            echo "Model matches SER9. Setting up firmware links..."
            mkdir -p /var/tmp
            ln -sf /usr/share/batocera/firmware/dcn_3_5_dmcub.bin /var/tmp/dcn_3_5_dmcub.bin
            ln -sf /var/tmp/dcn_3_5_dmcub.bin /lib/firmware/amdgpu/dcn_3_5_dmcub.bin
        fi
        ;;
    *)
        echo "Usage: $0 start"
        exit 1
        ;;
esac

exit 0
